home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / appkit / View.h < prev    next >
Text File  |  1993-01-04  |  9KB  |  289 lines

  1. /*
  2.     View.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "Window.h"
  8. #import "screens.h"
  9. #import <time.h>
  10.  
  11. /* Autosizing parameters */
  12.  
  13. #define    NX_NOTSIZABLE        (0)
  14. #define    NX_MINXMARGINSIZABLE    (1)
  15. #define    NX_WIDTHSIZABLE        (2)
  16. #define    NX_MAXXMARGINSIZABLE    (4)
  17. #define    NX_MINYMARGINSIZABLE    (8)
  18. #define    NX_HEIGHTSIZABLE    (16)
  19. #define    NX_MAXYMARGINSIZABLE    (32)
  20.  
  21. /* Are we drawing, printing, or copying PostScript to the scrap? */
  22.  
  23. extern short NXDrawingStatus;
  24.  
  25. /* NXDrawingStatus values */
  26.  
  27. #define NX_DRAWING    1    /* we're drawing */
  28. #define NX_PRINTING    2    /* we're printing */
  29. #define NX_COPYING    3    /* we're copying to the scrap */
  30.  
  31. extern BOOL NXScreenDump;    /* Do we draw selection while printing? */
  32.  
  33. @interface View : Responder
  34. {
  35.     NXRect              frame;
  36.     NXRect              bounds;
  37.     id                  superview;
  38.     id                  subviews;
  39.     id                  window;
  40.     struct __vFlags {
  41. #ifdef __BIG_ENDIAN__
  42.     unsigned int        noClip:1;
  43.     unsigned int        translatedDraw:1;
  44.     unsigned int        drawInSuperview:1;
  45.     unsigned int        alreadyFlipped:1;
  46.     unsigned int        needsFlipped:1;
  47.     unsigned int        rotatedFromBase:1;
  48.     unsigned int        rotatedOrScaledFromBase:1;
  49.     unsigned int        opaque:1;
  50.     unsigned int        disableAutodisplay:1;
  51.     unsigned int        needsDisplay:1;
  52.     unsigned int        validGState:1;
  53.     unsigned int        newGState:1;
  54.     unsigned int        _RESERVED:2;
  55.     unsigned int        _noVerticalAutosizing:1;
  56.     unsigned int        _hasDirtySubview:1;
  57. #else
  58.     unsigned int        _hasDirtySubview:1;
  59.     unsigned int        _noVerticalAutosizing:1;
  60.     unsigned int        _RESERVED:2;
  61.     unsigned int        newGState:1;
  62.     unsigned int        validGState:1;
  63.     unsigned int        needsDisplay:1;
  64.     unsigned int        disableAutodisplay:1;
  65.     unsigned int        opaque:1;
  66.     unsigned int        rotatedOrScaledFromBase:1;
  67.     unsigned int        rotatedFromBase:1;
  68.     unsigned int        needsFlipped:1;
  69.     unsigned int        alreadyFlipped:1;
  70.     unsigned int        drawInSuperview:1;
  71.     unsigned int        translatedDraw:1;
  72.     unsigned int        noClip:1;
  73. #endif
  74.     }                   vFlags;
  75.     struct ___vFlags {
  76. #ifdef __BIG_ENDIAN__
  77.     unsigned int        autosizing:6;
  78.     unsigned int        autoresizeSubviews:1;
  79.     unsigned int        notifyWhenFlipped:1;
  80.     unsigned int        ancestorNotifyWasEnabled:1;
  81.     unsigned int        needsAncestorNotify:1;
  82.     unsigned int        notifyToInitGState:1;
  83.     unsigned int        wantsGState:1;
  84.     unsigned int        noCopyOnScroll:1;
  85.     unsigned int        noDisplayOnScroll:1;
  86.     unsigned int        specialClip:1;
  87.     unsigned int        mark:1;
  88. #else
  89.     unsigned int        mark:1;
  90.     unsigned int        specialClip:1;
  91.     unsigned int        noDisplayOnScroll:1;
  92.     unsigned int        noCopyOnScroll:1;
  93.     unsigned int        wantsGState:1;
  94.     unsigned int        notifyToInitGState:1;
  95.     unsigned int        needsAncestorNotify:1;
  96.     unsigned int        ancestorNotifyWasEnabled:1;
  97.     unsigned int        notifyWhenFlipped:1;
  98.     unsigned int        autoresizeSubviews:1;
  99.     unsigned int        autosizing:6;
  100. #endif
  101.     }                   _vFlags;
  102.     int                 _gState;
  103.     id                  _frameMatrix;
  104.     id                  _drawMatrix;
  105.     NXAtom           *_dragTypes;
  106.     void *             _vPrivate;
  107. }
  108.  
  109. - init;
  110. - initFrame:(const NXRect *)frameRect;
  111. - awake;
  112. - free;
  113. - window;
  114. - superview;
  115. - subviews;
  116. - (BOOL)isDescendantOf:aView;
  117. - findAncestorSharedWith:aView;
  118. - opaqueAncestor;
  119. - addSubview:aView;
  120. - addSubview:aView :(int)place relativeTo:otherView;
  121. - windowChanged:newWindow;
  122. - removeFromSuperview;
  123. - replaceSubview:oldView with:newView;
  124. - notifyAncestorWhenFrameChanged:(BOOL)flag;
  125. - suspendNotifyAncestorWhenFrameChanged:(BOOL)flag;
  126. - notifyWhenFlipped:(BOOL)flag;
  127. - descendantFrameChanged:sender;
  128. - descendantFlipped:sender;
  129. - resizeSubviews:(const NXSize *)oldSize;
  130. - superviewSizeChanged:(const NXSize *)oldSize;
  131. - setAutoresizeSubviews:(BOOL)flag;
  132. - setAutosizing:(unsigned int)mask;
  133. - (unsigned int)autosizing;
  134. - moveTo:(NXCoord)x :(NXCoord)y;
  135. - sizeTo:(NXCoord)width :(NXCoord)height;
  136. - setFrame:(const NXRect *)frameRect;
  137. - rotateTo:(NXCoord)angle;
  138. - moveBy:(NXCoord)deltaX :(NXCoord)deltaY;
  139. - sizeBy:(NXCoord)deltaWidth :(NXCoord)deltaHeight;
  140. - rotateBy:(NXCoord)deltaAngle;
  141. - getFrame:(NXRect *)theRect;
  142. - (float)frameAngle;
  143. - setDrawOrigin:(NXCoord)x :(NXCoord)y;
  144. - setDrawSize:(NXCoord)width :(NXCoord)height;
  145. - setDrawRotation:(NXCoord)angle;
  146. - translate:(NXCoord)x :(NXCoord)y;
  147. - scale:(NXCoord)x :(NXCoord)y;
  148. - rotate:(NXCoord)angle;
  149. - getBounds:(NXRect *)theRect;
  150. - (float)boundsAngle;
  151. - setFlipped:(BOOL)flag;
  152. - (BOOL)isFlipped;
  153. - (BOOL)isRotatedFromBase;
  154. - (BOOL)isRotatedOrScaledFromBase;
  155. - setOpaque:(BOOL)flag;
  156. - (BOOL)isOpaque;
  157. - convertPointFromSuperview:(NXPoint *)aPoint;
  158. - convertPointToSuperview:(NXPoint *)aPoint;
  159. - convertRectFromSuperview:(NXRect *)aRect;
  160. - convertRectToSuperview:(NXRect *)aRect;
  161. - convertPoint:(NXPoint *)aPoint fromView:aView;
  162. - convertPoint:(NXPoint *)aPoint toView:aView;
  163. - convertSize:(NXSize *)aSize fromView:aView;
  164. - convertSize:(NXSize *)aSize toView:aView;
  165. - convertRect:(NXRect *)aRect fromView:aView;
  166. - convertRect:(NXRect *)aRect toView:aView;
  167. - centerScanRect:(NXRect *)aRect;
  168. - (BOOL)canDraw;
  169. - setAutodisplay:(BOOL)flag;
  170. - (BOOL)isAutodisplay;
  171. - setNeedsDisplay:(BOOL)flag;
  172. - (BOOL)needsDisplay;
  173. - update;
  174. - drawInSuperview;
  175. - (int)gState;
  176. - allocateGState;
  177. - freeGState;
  178. - notifyToInitGState:(BOOL)flag;
  179. - initGState;
  180. - renewGState;
  181. - clipToFrame:(const NXRect *)frameRect;
  182. - (BOOL)lockFocus;
  183. - unlockFocus;
  184. - (BOOL)isFocusView;
  185. - setClipping:(BOOL)flag;
  186. - (BOOL)doesClip;
  187. - (BOOL)getVisibleRect:(NXRect *)theRect;
  188. - displayIfNeeded;
  189. - display:(const NXRect *)rects :(int)rectCount :(BOOL)clipFlag;
  190. - displayFromOpaqueAncestor:(const NXRect *)rects :(int)rectCount :(BOOL)clipFlag;
  191. - display:(const NXRect *)rects :(int)rectCount;
  192. - display;
  193. - drawSelf:(const NXRect *)rects :(int)rectCount;
  194. - scrollPoint:(const NXPoint *)aPoint;
  195. - scrollRectToVisible:(const NXRect *)aRect;
  196. - autoscroll:(NXEvent *)theEvent;
  197. - adjustScroll:(NXRect *)newVisible;
  198. - (BOOL)calcUpdateRects:(NXRect *)rects :(int *)rectCount :(NXRect *)enclRect :(NXRect *)goodRect;
  199. - invalidate:(const NXRect *)rects :(int)rectCount;
  200. - scrollRect:(const NXRect *)aRect by:(const NXPoint *)delta;
  201. - hitTest:(NXPoint *)aPoint;
  202. - (BOOL)mouse:(NXPoint *)aPoint inRect:(NXRect *)aRect;
  203. - findViewWithTag:(int)aTag;
  204. - (int)tag;
  205. - (BOOL)performKeyEquivalent:(NXEvent *)theEvent;
  206. - (BOOL)acceptsFirstMouse;
  207. - (BOOL)shouldDelayWindowOrderingForEvent:(NXEvent *)theEvent;
  208. - addCursorRect:(const NXRect *)aRect cursor:anObj;
  209. - removeCursorRect:(const NXRect *)aRect cursor:anObj;
  210. - discardCursorRects;
  211. - resetCursorRects;
  212. - (BOOL)shouldDrawColor;
  213. - write:(NXTypedStream *)stream;
  214. - read:(NXTypedStream *)stream;
  215.  
  216. /* 
  217.  * The following new... methods are now obsolete.  They remain in this  
  218.  * interface file for backward compatibility only.  Use Object's alloc method  
  219.  * and the init... methods defined in this class instead.
  220.  */
  221. + newFrame:(const NXRect *)frameRect;
  222. + new;
  223.  
  224. @end
  225.  
  226. @interface View(Printing)
  227.  
  228. - copyPSCodeInside:(const NXRect *)rect to:(NXStream *)stream;
  229. - writePSCodeInside:(const NXRect *)copyArea to:pasteboard;
  230. - printPSCode:sender;
  231. - faxPSCode:sender;
  232. - faxPSCode:sender
  233.     toList: (const char *const *) names 
  234.     numberList: (const char *const *) numbers 
  235.     sendAt:(time_t) when
  236.     wantsCover: (BOOL) cFlag
  237.     wantsNotify: (BOOL) nFlag
  238.     wantsHires: (BOOL) hFlag
  239.     faxName: (const char *) aString;
  240. - (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum;
  241. - openSpoolFile:(char *)filename;
  242. - beginPSOutput;
  243. - beginPrologueBBox:(const NXRect *)boundingBox creationDate:(const char *)dateCreated createdBy:(const char *)anApplication fonts:(const char *)fontNames forWhom:(const char *)user pages:(int)numPages title:(const char *)aTitle;
  244. - endHeaderComments;
  245. - endPrologue;
  246. - beginSetup;
  247. - endSetup;
  248. - beginPage:(int)ordinalNum label:(const char *)aString bBox:(const NXRect *)pageRect fonts:(const char *)fontNames;
  249. - beginPageSetupRect:(const NXRect *)aRect placement:(const NXPoint *)location;
  250. - addToPageSetup;
  251. - endPageSetup;
  252. - endPage;
  253. - beginTrailer;
  254. - endTrailer;
  255. - endPSOutput;
  256. - spoolFile:(const char *)filename;
  257. - (float)heightAdjustLimit;
  258. - (float)widthAdjustLimit;
  259. - adjustPageWidthNew:(float *)newRight left:(float)oldLeft right:(float)oldRight limit:(float)rightLimit;
  260. - adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
  261. - (BOOL)getRect:(NXRect *)theRect forPage:(int)page;
  262. - placePrintRect:(const NXRect *)aRect offset:(NXPoint *)location;
  263. - drawSheetBorder:(float)width :(float)height;
  264. - drawPageBorder:(float)width :(float)height;
  265.  
  266. @end
  267.  
  268.  
  269. @interface View(Drag)
  270. - dragImage:anImage at:(NXPoint *)viewLocation offset:(NXPoint *)initialOffset event:(NXEvent *)event pasteboard:(Pasteboard *)pboard source:sourceObj slideBack:(BOOL)slideFlag;
  271.  
  272. - registerForDraggedTypes:(const char *const *)newTypes count:(int)numTypes;
  273. - unregisterDraggedTypes;
  274. @end
  275.  
  276.  
  277. @interface View (IconDragging)
  278. - dragFile:(const char *)filename fromRect:(NXRect *)rect slideBack:(BOOL) aFlag event:(NXEvent *)event;
  279. @end
  280.  
  281. @interface View (RIBPrinting)
  282. - (BOOL)canPrintRIB;
  283. @end
  284.  
  285. @interface Object(NXPrintingUserInterface)
  286. - (BOOL)shouldRunPrintPanel:aView;
  287. @end
  288.  
  289.